﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace BG.Web.Controllers
{
    //[Authorize]
    public class HomeController : Controller
    {
        //
        // GET: /Home/

        public ActionResult Index(String p)
        {
            ViewBag.Bicycle = "current";
            //return View("Landing");
            if (User.Identity.IsAuthenticated)
            {
                if(User.IsInRole("Admin"))
                    return View("LandingAdmin");
                else if(User.IsInRole("Superuser"))
                    return View("LandingUser");
                else
                    return View("LandingUser");
            }
            else
            {
                return View("Landing");
            }
            //if (!String.IsNullOrEmpty(p))
            //    return View("Index");
            //else
            //    return View("Landing");
        }
        public ActionResult Home()
        {
            ViewBag.Bicycle = "current";
            return View("Index");
        }
        public ActionResult Profile()
        {
            ViewBag.Profile = "current";
            return View();
        }
        public ActionResult Landing()
        {
            return View();
            //if (!String.IsNullOrEmpty(p))
            //    return View("Index");
            //else
            //    return View("Landing");
        }

       

    }
}
